<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>sched_getscheduler</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_008_198">&nbsp;</a>NAME</h4><blockquote>
sched_getscheduler - get scheduling policy
(<b>REALTIME</b>)
</blockquote><h4><a name = "tag_000_008_199">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="sched.h.html">sched.h</a>&gt;

int sched_getscheduler(pid_t <i>pid</i>);
</code>
</pre>
</blockquote><h4><a name = "tag_000_008_200">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>sched_getscheduler()</i>
function returns the scheduling policy of the process specified by
<i>pid</i>.
If the value of
<i>pid</i>
is negative, the behaviour of the
<i>sched_getscheduler()</i>
function is unspecified.
<p>
The values that can be returned by
<i>sched_getscheduler()</i>
are defined in the header file
<i><a href="sched.h.html">&lt;sched.h&gt;</a></i>
<p>
If a process specified by
<i>pid</i>
exists and if the calling process has permission,
the scheduling policy will be returned
for the process whose process ID is equal to
<i>pid</i>.
<p>
If
<i>pid</i>
is zero, the scheduling policy will be returned for the calling process.
</blockquote><h4><a name = "tag_000_008_201">&nbsp;</a>RETURN VALUE</h4><blockquote>
Upon successful completion, the
<i>sched_getscheduler()</i>
function returns the scheduling policy of the specified process.
If unsuccessful, the function returns -1 and sets
<i>errno</i>
to indicate the error.
</blockquote><h4><a name = "tag_000_008_202">&nbsp;</a>ERRORS</h4><blockquote>
The 
<i>sched_getscheduler()</i>
function will fail if:
<dl compact>

<dt>[ENOSYS]<dd>
The function
<i>sched_getscheduler()</i>
is not supported by this implementation.

<dt>[EPERM]<dd>
The requesting process does not have permission
to determine the scheduling policy of the specified process.

<dt>[ESRCH]<dd>
No process can be found corresponding to that specified by
<i>pid</i>.

</dl>
</blockquote><h4><a name = "tag_000_008_203">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_008_204">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_008_205">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_008_206">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="sched_getparam.html">sched_getparam()</a></i>,
<i><a href="sched_setparam.html">sched_setparam()</a></i>,
<i><a href="sched_setscheduler.html">sched_setscheduler()</a></i>,
<i><a href="sched.h.html">&lt;sched.h&gt;</a></i>.
</blockquote><h4>DERIVATION</h4><blockquote>
Derived from the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995)
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>

